//
//  SWSystemAPI.h
//  SWIOSLibary
//
//  Created by shaowei on 6/11/15.
//  Copyright (c) 2015 LianZhan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface SWSystemAPI : NSObject

@end

/******************************************************************/

#ifdef __cplusplus
extern "C" {
#endif
    
    extern UIInterfaceOrientation getStatusBarOritation();
    extern BOOL isPortrait();
    extern CGRect getFixedScreenFrame();
    
#ifdef __cplusplus
}
#endif

/******************************************************************/

//iphone 屏幕的屏幕宽度 无论竖屏还是横屏都是320，不随屏幕方向改变
#define IPHONE_SCREEN_FIX_WIDTH      (CGRectGetWidth(getFixedScreenFrame()))

//iphone 屏幕的屏幕高度 无论竖屏还是横屏都是480或568..不随屏幕方向改变
#define IPHONE_SCREEN_FIX_HEIGHT     (CGRectGetHeight(getFixedScreenFrame()))

//用于 宽高比的转换
#define BMGetNewHeight(originCGSize, newWidth) (1.0f * newWidth * originCGSize.height / originCGSize.width)
#define BMGetNewWidth(originCGSize, newHeight) (1.0f * newHeight * originCGSize.width / originCGSize.height)


#define BMAutoResize568Height(height_568) ((height_568) * IPHONE_SCREEN_FIX_HEIGHT / 568.0f)
#define BMAutoResizeL568Height(height_568) ((IPHONE_SCREEN_FIX_HEIGHT <= 568.0f)?(height_568):((height_568) * IPHONE_SCREEN_FIX_HEIGHT / 568.0f))
#define BMAutoResize320Width(width_320) ((width_320) * IPHONE_SCREEN_FIX_WIDTH / 320.0f)

